package org.sam.swing.table.action;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.ImageIcon;

import org.jdesktop.swingx.JXTable;
import org.sam.swing.resource.ResourceLoader;

/**
 * 全选操作
 * 
 * @author sam
 *
 */
public class JSTableRullRowUnSelectAction extends JSTableBaseAction {

	private static final long serialVersionUID = 5396459601863867183L;

	/**
	 * 全选操作
	 * 
	 * @param table
	 */
	public JSTableRullRowUnSelectAction(JXTable table) {
		super(table);
		this.putValue(AbstractAction.NAME, "");
		this.putValue(AbstractAction.SMALL_ICON,
				new ImageIcon(ResourceLoader.getResource(ResourceLoader.IMAGE_UNSELECT)));
		this.putValue(SHORT_DESCRIPTION, "全不选");
	}

	/**
	 * 执行的按钮操作
	 */
	@Override
	public void actionPerformed(ActionEvent e) {
		try {
			this.getTable().clearSelection();
		} catch (Exception ex) {
			ex.printStackTrace();
		}
	}

}
